Skip to content

Fix effecttest LSP helpers after typescript-go update#302

Merged
mattiamanzati merged 1 commit into
mainfrom
fix/effecttest-lsp-response-unmarshal
Jul 7, 2026
Merged

Fix effecttest LSP helpers after typescript-go update#302
mattiamanzati merged 1 commit into
mainfrom
fix/effecttest-lsp-response-unmarshal

Conversation

@mattiamanzati

Copy link
Copy Markdown
Contributor

What changed

The typescript-go submodule bump in #299 changed the upstream LSP test client (testutil/lsptestutil): the untyped SendRequestWorker now leaves resp.Result as a raw json.Value, with typed decoding moved into the typed helpers via RequestInfo.UnmarshalResult.

Our internal/effecttest helpers still type-asserted the typed response structs on the raw result, so 6 tests failed on main:

  • TestEffectInlayHintsGenSuppression, TestEffectInlayHintsFnSuppression, TestEffectInlayHintsFnUntracedSuppression, TestEffectInlayHintsNonEffectNotSuppressed, TestEffectInlayHintsDisabledPassthroughUnexpected textDocument/inlayHint response type: jsontext.Value
  • TestAutoImportEffectStyleConsistency_barrelunexpected diagnostic response type

Fix

Decode the raw results with the matching RequestInfo.UnmarshalResult (same pattern as upstream's typed helpers):

// before
result, ok := resp.Result.(lsproto.InlayHintResponse)

// after
result, err := lsproto.TextDocumentInlayHintInfo.UnmarshalResult(resp.Result)

Applied to the inlay hint helper (inlay_hints_baseline_test.go) and the diagnostic + code action requests in autoimport_style_consistency_test.go. Also includes the go.work.sum refresh from the submodule dependency update.

Validation

  • pnpm lint — 0 issues
  • pnpm check — clean
  • pnpm test — full suite passes (previously failing 6 tests now green)

🤖 Generated with Claude Code

The typescript-go bump in #299 changed the LSP test client so the
untyped SendRequestWorker leaves resp.Result as a raw json.Value.
Decode results with RequestInfo.UnmarshalResult instead of
type-asserting the typed response structs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mattiamanzati mattiamanzati merged commit c45a407 into main Jul 7, 2026
5 checks passed
@mattiamanzati mattiamanzati deleted the fix/effecttest-lsp-response-unmarshal branch July 7, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant